<?php
include 'connect.php';
 if (isset($_GET['page'])) 
            {
                $page = $_GET['page'];
            } 
        else 
            {
                $page = 1;
            }
$offset = ($page - 1) * $limit;
 if (isset($_POST["btntim"]))
            {
                $querry =$con->query("select * from footwear where name LIKE '%{$search}%' ");    
            }
 elseif (isset($_GET['dm']))
    {
        $querry =$con->query("select * from footwear where category_foot= {$dm} LIMIT {$limit} OFFSET {$offset}");
    }
 else
    {
        $querry =$con->query("select * from footwear LIMIT {$limit} OFFSET {$offset}");
    }
     
while ($row = mysqli_fetch_array($querry))
{
?>
            <div class="bsp">
                <form method="post" action="cart.php">
                <input type="hidden" name="name" value="<?php echo $row["name"]; ?>">
                <input type="hidden" name="id" value="<?php echo $row["id"]; ?>">
                <input type="hidden" name="price" value="<?php echo $row["price"]; ?>">
                <input type="hidden" name="image" value="<?php echo $row["image"]; ?>">
                <input type="hidden" name="num" value="1">
                <a href="listdetail.php?gd=<?php echo $row['id'];?>"><img src="<?php echo $row["image"] ?>"/></a>
                <div class="bgia"><?php echo $row["name"]; ?></div>
                <div class="bgia"><div class="btext">Giá: </div><div class="color"><?php echo $row["price"] . " VNĐ"; ?></div></div>
                <div class="bgia"><input type="submit" value="Thêm vào giỏ hàng" name="addcart"/></div>
                </form>
            </div>
 <?php
}
 ?> 